<template>
  <tbody v-if="isShow">
    <tr v-for="item in data" :key="item.doctor">
      <td>{{ item.date }}</td>
      <td>{{ item.doctor }}</td>
      <td>{{ item.diagnosis }}</td>
      <td>{{ item.prescription }}</td>
      <td @click="showDia(item)">详情</td>
    </tr>
  </tbody>

  <xiang_qing v-else v-model="isShow" :data="item" @input="this.isShow = $event.target.value"></xiang_qing>
</template>

<script>
import xiang_qing from './xiang_qing.vue';

export default {
  data() {
    return {
      isShow: true,
      item: {},
    }
  },
  props: ['data'],
  methods: {
    showDia(item) {
      this.item = item
      this.isShow = false
    }
  },
  components: {
    xiang_qing
  },

}

</script>

<style></style>